package myJs.myPkg

import myJs.myPkg.jquery.JQuery
import myJs.myPkg.jsext._

import scala.scalajs.js
import scala.language.implicitConversions
import scala.scalajs.js.JSConverters._
import scala.scalajs.js.annotation.JSImport
import scala.scalajs.js.annotation.JSImport.Namespace


/**
 * Created by yz on 2019/3/14
 */

@js.native
trait DatepickerJQuery extends js.Object {

  def datepicker(options: DatepickerOptions): JQuery = scalajs.js.native

  def datepicker(method: String,arg1:String): JQuery = scalajs.js.native

}

object DatepickerOptions extends DatepickerOptionsBuilder(noOpts)

class DatepickerOptionsBuilder(val dict: OptMap) extends JSOptionBuilder[DatepickerOptions, DatepickerOptionsBuilder](new DatepickerOptionsBuilder(_)) {

  def format(v: String) = jsOpt("format", v)

  def language(v: String) = jsOpt("language", v)

  def autoclose(v: Boolean) = jsOpt("autoclose", v)

  def forceParse(v: Boolean) = jsOpt("forceParse", v)

  def showOnFocus(v: Boolean) = jsOpt("showOnFocus", v)

  def clearBtn(v: Boolean) = jsOpt("clearBtn", v)

}

trait DatepickerOptions extends js.Object {

}


trait DatepickerJQueryImplicits {

  implicit def implicitDatepickerJQuery(jq: JQuery) = {
    jq.asInstanceOf[DatepickerJQuery]
  }
}
